﻿namespace Fuse8.DomainFramework.Domain
{
	/// <summary>
	/// 
	/// </summary>
	public class SqlColumn
	{
		/// <summary>
		/// 
		/// </summary>
		public string SqlColumnName { get; set; }

		/// <summary>
		/// Present entity alias for sql column
		/// </summary>
		public string EntityPropertyName { get; set; }

		/// <summary>
		/// 
		/// </summary>
		public bool IsPrimaryKey { get; set; }

        /// <summary>
        /// 
        /// </summary>
	    public bool IsIdentity { get; set; }

		/// <summary>
		/// Returns EntityPropertyName if special name exists and SqlColumnName otherwise
		/// </summary>
		public string EffectiveName
		{
			get { return !string.IsNullOrEmpty(EntityPropertyName) ? EntityPropertyName : SqlColumnName; }
		}
	}
}